﻿package mortal.game.view.issm
{
    import com.mui.controls.*;
    import extend.language.*;
    import flash.events.*;
    import flash.text.*;
    import mortal.common.global.*;
    import mortal.component.window.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.mvc.core.*;
    import mortal.mvc.interfaces.*;

    public class IssmModule extends SmallWindow
    {
        private var _btnOk:GButton;
        private var _btnCancel:GButton;
        private var _txtNameInput:GTextInput;
        private var _txtIDCardInput:GTextInput;

        public function IssmModule(param1:ILayer = null)
        {
            super(param1);
            setSize(700, 426);
            title = Language.getString(11817);
            paddingBottom = 80;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            var _loc_1:* = ParamsConst.instance.gameName;
            var _loc_2:* = Language.getString(11818) + Language.getString(11819) + Language.getString(11820) + Language.getStringByParam(11821, _loc_1) + Language.getString(11822) + Language.getString(11823) + Language.getString(11824) + Language.getStringByParam(11825, _loc_1) + Language.getString(11826);
            var _loc_3:* = UIFactory.textField(_loc_2, 27, 48, 665, 290, this, GlobalStyle.textFormatPutong, true);
            _loc_3.wordWrap = true;
            _loc_3.multiline = true;
            pushUIToDisposeVec(_loc_3);
            pushUIToDisposeVec(UIFactory.bg(13, 356, 686, 66, this, ImagesConst.PanelBg));
            var _loc_4:* = GlobalStyle.textFormatBai;
            _loc_4.size = 14;
            pushUIToDisposeVec(UIFactory.textField(Language.getString(11827), 50, 376, 50, 22, this, _loc_4));
            pushUIToDisposeVec(UIFactory.textField(Language.getString(11828), 229, 376, 85, 22, this, _loc_4));
            this._txtNameInput = UIFactory.gTextInput(94, 378, 110, 22, this);
            this._txtNameInput.maxChars = 15;
            this._txtNameInput.restrict = Language.getString(11829);
            this._txtNameInput.defaultText = Language.getString(11830);
            this._txtIDCardInput = UIFactory.gTextInput(320, 378, 168, 22, this);
            this._txtIDCardInput.maxChars = 18;
            this._txtIDCardInput.restrict = "X0-9";
            this._txtIDCardInput.defaultText = Language.getString(11832);
            this._btnOk = UIFactory.gButton(Language.getString(11833), 515, 378, 55, 22, this);
            this._btnCancel = UIFactory.gButton(Language.getString(11834), 595, 378, 55, 22, this);
            this.configEventListener(MouseEvent.CLICK, this.onMouseClickHandler);
            return;
        }// end function

        private function onMouseClickHandler(event:MouseEvent) : void
        {
            var _loc_2:Object = null;
            switch(event.target)
            {
                case this._btnCancel:
                {
                    this.hide();
                    break;
                }
                case this._btnOk:
                {
                    if (this._txtNameInput.text == "")
                    {
                        MsgManager.showRollTipsMsg(Language.getString(11830));
                        return;
                    }
                    if (this._txtIDCardInput.text == "")
                    {
                        MsgManager.showRollTipsMsg(Language.getString(11832));
                        return;
                    }
                    _loc_2 = {};
                    _loc_2.name = this._txtNameInput.text;
                    _loc_2.card = this._txtIDCardInput.text;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.IssmCommit, _loc_2));
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        override public function show(param1:int = 0, param2:int = 0) : void
        {
            super.show(param1, param2);
            PopupManager.closeAllFullView();
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            paddingBottom = 80;
            this._btnOk.dispose(param1);
            this._btnCancel.dispose(param1);
            this._txtNameInput.dispose(param1);
            this._txtIDCardInput.dispose(param1);
            this._btnOk = null;
            this._btnCancel = null;
            this._txtNameInput = null;
            this._txtIDCardInput = null;
            return;
        }// end function

    }
}
